#include<stdio.h>
int main()
{int take(int n,int m);
int a,b;
scanf("%d%d",&a,&b);
printf("\n"); 
printf("%d",take(a,b));
return 0;
}
int take(int n,int m)
{int x,y,z;
for(x=0;x<m;x++)
y=n/10;
z=y%10;
return z;
}

